import { NgModule } from "@angular/core";
import { RouterModule } from "@angular/router";
import { FormsModule } from "@angular/forms";
import { CommonModule } from "@angular/common";
import { UiSwitchModule } from 'ngx-ui-switch';
import { FilterComponent } from "./filter/filter.component";
import { ReportingComponent } from "./reporting.component";
import { ReportingPipe } from "./reporting.pipe";
import { ModalModule } from "../../shared/components/modal/modal.module";
import { BaseCriteriaComponent } from "./filter/criteria/base/baseCriteria.component";
import { TemplateCriteriaComponent } from "./filter/criteria/template/templateCriteria.component";
import { CriteriaComponent } from "./filter/criteria/criteria.component";
import { ScreenablePipe } from "./filter/criteria/template/screenable.pipe";
import { Type2Component } from "./filter/criteria/template/types/type2/type2.component";
import { Type3Component } from "./filter/criteria/template/types/type3/type3.component";
import { Type5Component } from "./filter/criteria/template/types/type5/type5.component";
import { Type6Component } from "./filter/criteria/template/types/type6/type6.component";
import { Type8Component } from "./filter/criteria/template/types/type8/type8.component";
import { Type9Component } from "./filter/criteria/template/types/type9/type9.component";
import { Type17Component } from "./filter/criteria/template/types/type17/type17.component";
import { Type25Component } from "./filter/criteria/template/types/type25/type25.component";
import { SliderModule } from "../../shared/components/slider/slider.module";
import { ChartsModule } from "../../shared/directives/charts.module";
import { PipesModule } from "../../shared/pipes/pipes.module";
import { Type1Component } from "./filter/criteria/template/types/type1/type1.component";
import { Type16Component } from "./filter/criteria/template/types/type16/type16.component";
import { Type7Component } from "./filter/criteria/template/types/type7/type7.component";
import { Type4Component } from "./filter/criteria/template/types/type4/type4.component";
import { DefaultComponent } from "./filter/criteria/template/types/default/default.component";
import { TableModule } from "../../shared/components/table/table.module";
import { MultiselectDropdownModule } from "angular-2-dropdown-multiselect";
import { PortfolioService } from "../portfolio/portfolio.service";
import { SearchModule } from "../../shared/components/search/search.module";
import { SortablejsModule } from 'angular-sortablejs/dist';
import { CriteriaListingComponent } from "./filter/criteriaListing/criteriaListing.component";
import { FilterExportComponent } from "./filter/export/export.component";
import { ResultsComponent } from "./filter/results/results.component";
import { SettingsComponent } from "./filter/settings/settings.component";
import { ReportAllComponent } from "./filter/criteria/template/types/reportAll/reportAll.component";
import { CompanyEsgService } from "../research/company/esg/companyEsg.service";

const routes = [{
    path: ':type',
    component: ReportingComponent
},
{
    path: ':type/filter/:id',
    component: FilterComponent,
    children: [    
        {
            path: ':edit/level1/default',
            component: DefaultComponent,
            outlet: 'criteria'
        },            
        {
            path: ':edit/level1/:lvl1/level2/:lvl2',
            component: BaseCriteriaComponent,
            outlet: 'criteria'            
        },            
        {
            path: ':edit/level1/:lvl1/level2/:lvl2/level3/:lvl3/shortName/:shortName/name/:name',
            component: TemplateCriteriaComponent,
            outlet: 'criteria'
        },
        {
            path: ':edit/level1/:lvl1/level2/:lvl2/all',
            component: ReportAllComponent,
            outlet: 'criteria'
        },  
    ]
}];

@NgModule({
    providers: [
        PortfolioService,
        CompanyEsgService
    ],
    imports: [
        CommonModule,
        FormsModule,
        ModalModule,
        SliderModule,
        ChartsModule,
        PipesModule,
        TableModule,
        MultiselectDropdownModule,
        SearchModule,
        UiSwitchModule,
        RouterModule.forChild(routes),
        SortablejsModule
    ],
    declarations: [
        ReportingComponent,
        FilterComponent,
        SettingsComponent,
        CriteriaListingComponent,
        FilterExportComponent,
        ResultsComponent,
        ReportingPipe,

        ScreenablePipe,
        CriteriaComponent,
        BaseCriteriaComponent,
        TemplateCriteriaComponent,
        
        //criteria templates
        DefaultComponent,
        ReportAllComponent,
        Type1Component,
        Type2Component,
        Type3Component,
        Type4Component,
        Type5Component,
        Type6Component,
        Type7Component,
        Type8Component,
        Type9Component,
        Type16Component,
        Type17Component,
        Type25Component
    ]
})
export class ReportingModule { }